package com.zzyl.service.impl;

import com.zzyl.mapper.NursingProjectPlanMapper;
import com.zzyl.service.NursingProjectPlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Author 11913
 * @Date 2024/12/15 16:36
 *
 * 护理计划和项目关联表业务层
 */

@Service
public class NersingProjectPlanServiceImpl implements NursingProjectPlanService {

    @Autowired
    NursingProjectPlanMapper nursingProjectPlanMapper;

    /**
     * 删除护理计划之前的判断
     * @param id
     * @return
     */
    @Override
    public int findIdJob(Long id) {
        // 调用Mapper层,删除护理计划之前判断该计划是否被调用
        int selectCount = nursingProjectPlanMapper.findIdJob(id);
        // 返回数据
        return selectCount;

    }

    /**
     * 根据护理计划删除关联关系
     * @param nursingPrijectPlanId
     */
    @Override
    public void deleteByIdNpp(Long nursingPrijectPlanId) {
        nursingProjectPlanMapper.deleteByIdNpp(nursingPrijectPlanId);

    }
}
